package com.xz.realdemo.factory;

import com.xz.realdemo.entity.database.oracle.OracleConnection;
import com.xz.realdemo.entity.database.oracle.OracleStatement;
import com.xz.realdemo.model.Connection;
import com.xz.realdemo.model.Statement;

/**
 * @author 张志航     
 * @version V1.0.0
 * @projectName design_mode
 * @title     OracleDatabaseFactory   
 * @package    com.xz.realdemo.factory  
 * @date   2019/11/27 11:52  
 * @explain
 */
public class OracleDatabaseFactory implements DatabaseFactory{
    @Override
    public Connection createConnection() {
        return new OracleConnection();
    }

    @Override
    public Connection createConnection(String ip, String port) {
        Connection connection = new OracleConnection();
        connection.setPort(port);
        connection.setIp(ip);
        return connection;
    }

    @Override
    public Statement createStatement() {
        return new OracleStatement();
    }
}
